#include "pause.h"
#include "ui_pause.h"

Pause::Pause(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Pause)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::Window);

    //设置背景图片
    QPalette palette = this->palette();
    palette.setBrush(this->backgroundRole(),QBrush(QPixmap(":/resources/green.jpg")));
    this->setPalette(palette);
}

Pause::~Pause()
{
    delete ui;
}

/**
 * @brief 返回游戏
 *
 */
void Pause::on_pushButton_2_clicked()
{
    this->hide();
    emit backGame();
}

/**
 * @brief 音乐设置
 *
 */
void Pause::on_pushButton_3_clicked()
{
    this->hide();
    emit enterMusic();
}

/**
 * @brief 排行榜
 *
 */
void Pause::on_pushButton_4_clicked()
{
    this->hide();
    emit enterRank();
}

/**
 * @brief 结束游戏
 *
 */
void Pause::on_pushButton_5_clicked()
{
    this->hide();
    emit enterSave();
}
